//
//  SDVedioInfoViewController.m
//  for_test
//
//  Created by Carlson Lee on 2017/4/1.
//  Copyright © 2017年 Carlson Lee. All rights reserved.
//

#import "SDVedioInfoViewController.h"
#import "VideoInfoView.h"
#import "VoiceFollowView.h"
#import "VoiceFollowMaskView.h"
#import "VideoRecordView.h"

@interface SDVedioInfoViewController ()

@property(nonatomic, strong)UIScrollView* scroll;
@property(nonatomic, strong)VideoInfoView* itemFaceRecog;
@property(nonatomic, strong)VideoInfoView* itemVoiceFollow;
@property(nonatomic, strong)VoiceFollowMaskView* maskView;

@property(nonatomic, strong)VoiceFollowView* voiceView;
@property(nonatomic, strong)VideoRecordView* recordView;

@end

@implementation SDVedioInfoViewController

- (UIScrollView *)scroll
{
    if(!_scroll){
        _scroll  = [[UIScrollView alloc]init];
        [self.view addSubview:_scroll];
    }
    return _scroll;
}

- (VideoInfoView *)itemFaceRecog
{
    if(!_itemFaceRecog){
        _itemFaceRecog = [[VideoInfoView alloc]init];
        [self.scroll addSubview:_itemFaceRecog];
    }
    return _itemFaceRecog;
}

- (VideoInfoView *)itemVoiceFollow
{
    if(!_itemVoiceFollow){
        _itemVoiceFollow = [[VideoInfoView alloc]init];
        [self.scroll addSubview:_itemVoiceFollow];
    }
    return _itemVoiceFollow;
}

- (VoiceFollowView *)voiceView
{
    if(!_voiceView){
        _voiceView = [[VoiceFollowView alloc]init];
        [self.view addSubview:_voiceView];
        [_voiceView setBackgroundColor:AlphaColorWithRGBA(0xf2f0f5, .6)];
    }
    return _voiceView;
}

- (VoiceFollowMaskView *)maskView
{
    if(!_maskView){
        _maskView = [[VoiceFollowMaskView alloc]init];
        [self.view addSubview:_maskView];
    }
    return _maskView;
}

- (VideoRecordView *)recordView
{
    if(!_recordView){
        _recordView = [[VideoRecordView alloc]init];
        [self.view addSubview:_recordView];
    }
    return _recordView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    /*
    self.title = @"音影资料";
    [self.view setBackgroundColor:THEME_BACKGROUND_COLOR];
    
    [self.itemFaceRecog setImg:@"face_recognition" describle:@"开始人脸识别，确保五官清晰" WithBlock:^(BOOL isComplete) {
        
    }];
    
    [self.itemVoiceFollow setImg:@"voice_follow" describle:@"请跟着女声朗读，按要求录制视频" WithBlock:^(BOOL isComplete) {
        
    }];
     */
    /*
    NSString* voice = @"本人自愿向中银消费申请贷款，提供真实资料，遵守合约，同意上报征信";
    self.voiceView.frame = CGRectMake((UIFrameW(self.view)-CELL_WIDTH*11)/2, 100, CELL_WIDTH*11, CELL_WIDTH*3);
    self.voiceView.voiceStr = voice;
    */
    self.maskView.frame = CGRectMake(0, 100, mainWidth, 300);
    
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    /*
    self.scroll.frame = self.view.bounds;
    self.itemFaceRecog.frame = CGRectMake(0, 20*ScaleX, mainWidth, 205*ScaleX);
    self.itemVoiceFollow.frame = CGRectMake(0, CGRectGetMaxY(self.itemFaceRecog.frame)+10*ScaleX, mainWidth, 205*ScaleX);
    [self.scroll setContentSize:CGSizeMake(0, CGRectGetMaxY(self.itemVoiceFollow.frame))];
     */
    
    //self.voiceView.frame = CGRectMake((UIFrameW(self.view)-CELL_WIDTH*11)/2, 100, CELL_WIDTH*11, CELL_WIDTH*3);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
